"""GoGoods URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""

"""
urls.py文件的核心功能:
是将客户端发起的 HTTP 请求的 URL 与 Django 应用中的视图函数或类视图进行映射。
当用户在浏览器中输入一个 URL 并访问网站时，Django 会根据urls.py中定义的规则
来确定应该调用哪个视图函数来处理该请求。
"""
from xml.etree.ElementInclude import include

from django.contrib import admin
from django.urls import path,include
#from django.http import HttpResponse
# def log(request):
#     #1.导入
#     import logging
#     #2.创建日志器
#     logger=logging.getLogger('django')
#     #3.调动日志器的方法来保存日志
#     logger.info('用户登录了')
#     logger.info('redis缓存不足')
#     logger.error('该记录不存在')
#     logger.debug('-----------')
#     return HttpResponse('log')
#注册转换器
from utils.converters import UsernameConverter
from django.urls import register_converter
register_converter(UsernameConverter,'username')
urlpatterns = [
    path('admin/', admin.site.urls),
    #导入 users 子应用的路由
    path('',include('apps.users.urls')),
    path('',include('apps.verifications.urls')),
]
